using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using System.Xml;
using ComponentFactory.Krypton.Toolkit;
using DukeyCssFetch.api;

namespace DukeyCssFetch.UI
{
	// Token: 0x02000035 RID: 53
	public class TagEditFrm : KryptonForm
	{
		// Token: 0x06000220 RID: 544 RVA: 0x0001BB08 File Offset: 0x00019D08
		static TagEditFrm()
		{
			// Note: this type is marked as 'beforefieldinit'.
		}

		// Token: 0x06000210 RID: 528 RVA: 0x00019AAC File Offset: 0x00017CAC
		public TagEditFrm()
		{
			
			this.InitializeComponent();
		}

		// Token: 0x06000211 RID: 529 RVA: 0x00019AC0 File Offset: 0x00017CC0
		public TagEditFrm(bool edit)
		{
			
			this.InitializeComponent();
			this.txtCms.Text = Comm.CurrentTag.Replace(".xml", "");
			this.method_0();
		}

		// Token: 0x06000217 RID: 535 RVA: 0x0001A58C File Offset: 0x0001878C
		private void btnAdd_Click(object sender, EventArgs e)
		{
			this.lbloptips.Text = "新增标签";
			this.btnUpdateGroup.Enabled = false;
			this.btnOK.Enabled = true;
			TagEditFrm.treeNode_0 = null;
			this.txtTagName.Text = "";
			this.WllYkmDbab.Text = "";
			this.txtTips.Text = "";
			this.txtTagName.Focus();
		}

		// Token: 0x06000216 RID: 534 RVA: 0x0001A584 File Offset: 0x00018784
		private void btnClose_Click(object sender, EventArgs e)
		{
			base.Close();
		}

		// Token: 0x06000212 RID: 530 RVA: 0x00019AF8 File Offset: 0x00017CF8
		private void btnOK_Click(object sender, EventArgs e)
		{
			string text = this.txtGroupName.Text.Trim();
			string text2 = this.txtTagName.Text.Trim();
			string text3 = this.WllYkmDbab.Text.Trim();
			string str = this.txtTips.Text.Trim();
			if (string.IsNullOrEmpty(text))
			{
				this.lblTips.Text = "请填写组名称!";
				return;
			}
			if (string.IsNullOrEmpty(text2))
			{
				this.lblTips.Text = "请填写标签名称!";
				return;
			}
			if (string.IsNullOrEmpty(text3))
			{
				this.lblTips.Text = "请填写标签值!";
				return;
			}
			string str2 = this.txtCms.Text.Trim() + ".xml";
			string text4 = Comm.root + "\\tag\\" + str2;
			if (!File.Exists(text4))
			{
				using (StreamWriter streamWriter = File.CreateText(text4))
				{
					streamWriter.WriteLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
					streamWriter.WriteLine("<tags>");
					streamWriter.WriteLine("</tags>");
				}
			}
			try
			{
				XmlDocument xmlDocument = new XmlDocument();
				xmlDocument.Load(text4);
				if (TagEditFrm.treeNode_0 == null)
				{
					XmlNode xmlNode = xmlDocument.SelectSingleNode("//tags");
					if (xmlNode == null)
					{
						xmlNode = xmlDocument.CreateNode("element", "tags", "");
						xmlDocument.AppendChild(xmlNode);
					}
					XmlNode xmlNode2 = xmlDocument.SelectSingleNode("//tags/group[@name='" + text + "']");
					if (xmlNode2 == null)
					{
						xmlNode2 = xmlDocument.CreateNode("element", "group", "");
						XmlAttribute xmlAttribute = xmlDocument.CreateAttribute("name");
						xmlAttribute.Value = text;
						xmlNode2.Attributes.Append(xmlAttribute);
						xmlNode.AppendChild(xmlNode2);
					}
					XmlNode xmlNode3 = xmlDocument.SelectSingleNode(string.Concat(new string[]
					{
						"//tags/group[@name='",
						text,
						"']/tag[@name='",
						text2,
						"']"
					}));
					if (xmlNode3 == null)
					{
						xmlNode3 = xmlDocument.CreateNode("element", "tag", "");
						XmlAttribute xmlAttribute2 = xmlDocument.CreateAttribute("name");
						xmlAttribute2.Value = text2;
						xmlNode3.Attributes.Append(xmlAttribute2);
						xmlNode2.AppendChild(xmlNode3);
					}
					XmlNode xmlNode4 = xmlDocument.SelectSingleNode(string.Concat(new string[]
					{
						"//tags/group[@name='",
						text,
						"']/tag[@name='",
						text2,
						"']/value"
					}));
					if (xmlNode4 == null)
					{
						xmlNode4 = xmlDocument.CreateNode("element", "value", "");
						xmlNode3.AppendChild(xmlNode4);
					}
					xmlNode4.InnerXml = "<![CDATA[" + text3 + "]]>";
					XmlNode xmlNode5 = xmlDocument.SelectSingleNode(string.Concat(new string[]
					{
						"//tags/group[@name='",
						text,
						"']/tag[@name='",
						text2,
						"']/tips"
					}));
					if (xmlNode5 == null)
					{
						xmlNode5 = xmlDocument.CreateNode("element", "tips", "");
						xmlNode3.AppendChild(xmlNode5);
					}
					xmlNode5.InnerXml = "<![CDATA[" + str + "]]>";
					xmlDocument.Save(text4);
					this.lblTips.Text = "增加标签成功 " + DateTime.Now.ToString("mm:ss");
					this.txtTagName.Text = "";
					this.WllYkmDbab.Text = "";
					this.txtTips.Text = "";
				}
				else
				{
					TreeNode treeNode = TagEditFrm.treeNode_0 as TreeNode;
					if (treeNode != null && treeNode.Tag != null)
					{
						TagInfo tagInfo = treeNode.Tag as TagInfo;
						XmlNode xmlNode6 = xmlDocument.SelectSingleNode(string.Concat(new string[]
						{
							"//tags/group[@name='",
							tagInfo.GroupName,
							"']/tag[@name='",
							tagInfo.TagName,
							"']"
						}));
						if (xmlNode6 != null)
						{
							XmlAttribute xmlAttribute3 = xmlDocument.CreateAttribute("name");
							xmlAttribute3.Value = text2;
							xmlNode6.Attributes.Append(xmlAttribute3);
							XmlNode xmlNode7 = xmlDocument.SelectSingleNode(string.Concat(new string[]
							{
								"//tags/group[@name='",
								tagInfo.GroupName,
								"']/tag[@name='",
								tagInfo.TagName,
								"']/value"
							}));
							if (xmlNode7 == null)
							{
								xmlNode7 = xmlDocument.CreateNode("element", "value", "");
								xmlNode6.AppendChild(xmlNode7);
							}
							xmlNode7.InnerXml = "<![CDATA[" + text3 + "]]>";
							XmlNode xmlNode8 = xmlDocument.SelectSingleNode(string.Concat(new string[]
							{
								"//tags/group[@name='",
								tagInfo.GroupName,
								"']/tag[@name='",
								tagInfo.TagName,
								"']/tips"
							}));
							if (xmlNode8 == null)
							{
								xmlNode8 = xmlDocument.CreateNode("element", "tips", "");
								xmlNode6.AppendChild(xmlNode8);
							}
							xmlNode8.InnerXml = "<![CDATA[" + str + "]]>";
							xmlDocument.Save(text4);
							this.lblTips.Text = "更新标签成功 " + DateTime.Now.ToString("mm:ss");
						}
					}
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
			this.method_0();
		}

		// Token: 0x0600021C RID: 540 RVA: 0x0001A798 File Offset: 0x00018998
		private void btnUpdateGroup_Click(object sender, EventArgs e)
		{
			try
			{
				string str = this.txtCms.Text.Trim() + ".xml";
				string filename = Comm.root + "\\tag\\" + str;
				XmlDocument xmlDocument = new XmlDocument();
				xmlDocument.Load(filename);
				TreeNode treeNode = TagEditFrm.treeNode_0 as TreeNode;
				TagInfo tagInfo = treeNode.Tag as TagInfo;
				XmlNode xmlNode = xmlDocument.SelectSingleNode("//tags/group[@name='" + tagInfo.GroupName + "']");
				if (xmlNode != null)
				{
					XmlAttribute xmlAttribute = xmlDocument.CreateAttribute("name");
					xmlAttribute.Value = this.txtGroupName.Text.Trim();
					xmlNode.Attributes.Append(xmlAttribute);
					xmlDocument.Save(filename);
				}
				this.lblTips.Text = "更新组名成功!" + DateTime.Now.ToString("HH:ss");
				this.method_0();
			}
			catch
			{
			}
		}

		// Token: 0x0600021E RID: 542 RVA: 0x0001A8A8 File Offset: 0x00018AA8
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.icontainer_0 != null)
			{
				this.icontainer_0.Dispose();
			}
			base.Dispose(disposing);
		}

		// Token: 0x0600021F RID: 543 RVA: 0x0001A8C8 File Offset: 0x00018AC8
		private void InitializeComponent()
		{
			this.icontainer_0 = new Container();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(TagEditFrm));
			this.splitContainer1 = new SplitContainer();
			this.treeTags = new TreeView();
			this.menuGroup = new ContextMenuStrip(this.icontainer_0);
			this.增加标签ToolStripMenuItem = new ToolStripMenuItem();
			this.编辑组名称ToolStripMenuItem = new ToolStripMenuItem();
			this.删除改组ToolStripMenuItem = new ToolStripMenuItem();
			this.删除标签ToolStripMenuItem = new ToolStripMenuItem();
			this.label2 = new Label();
			this.label1 = new Label();
			this.lbloptips = new Label();
			this.linkLabel1 = new LinkLabel();
			this.lblTips = new Label();
			this.btnAdd = new KryptonButton();
			this.btnClose = new KryptonButton();
			this.btnUpdateGroup = new KryptonButton();
			this.kryptonButton_0 = new KryptonButton();
			this.btnOK = new KryptonButton();
			this.kryptonLabel3 = new KryptonLabel();
			this.kryptonLabel2 = new KryptonLabel();
			this.kryptonLabel7 = new KryptonLabel();
			this.kryptonLabel5 = new KryptonLabel();
			this.kryptonLabel4 = new KryptonLabel();
			this.kryptonLabel1 = new KryptonLabel();
			this.txtTips = new KryptonTextBox();
			this.WllYkmDbab = new KryptonTextBox();
			this.txtCms = new KryptonTextBox();
			this.txtGroupName = new KryptonTextBox();
			this.txtTagName = new KryptonTextBox();
			this.kryptonLabel6 = new KryptonLabel();
			this.txtPx = new KryptonTextBox();
			this.openFileDialog_0 = new OpenFileDialog();
			this.toolTip_0 = new ToolTip(this.icontainer_0);
			this.linkLabel3 = new LinkLabel();
			this.splitContainer1.Panel1.SuspendLayout();
			this.splitContainer1.Panel2.SuspendLayout();
			this.splitContainer1.SuspendLayout();
			this.menuGroup.SuspendLayout();
			base.SuspendLayout();
			this.splitContainer1.Dock = DockStyle.Fill;
			this.splitContainer1.Location = new Point(0, 0);
			this.splitContainer1.Name = "splitContainer1";
			this.splitContainer1.Panel1.Controls.Add(this.treeTags);
			this.splitContainer1.Panel2.Controls.Add(this.label2);
			this.splitContainer1.Panel2.Controls.Add(this.label1);
			this.splitContainer1.Panel2.Controls.Add(this.lbloptips);
			this.splitContainer1.Panel2.Controls.Add(this.linkLabel3);
			this.splitContainer1.Panel2.Controls.Add(this.linkLabel1);
			this.splitContainer1.Panel2.Controls.Add(this.lblTips);
			this.splitContainer1.Panel2.Controls.Add(this.btnAdd);
			this.splitContainer1.Panel2.Controls.Add(this.btnClose);
			this.splitContainer1.Panel2.Controls.Add(this.btnUpdateGroup);
			this.splitContainer1.Panel2.Controls.Add(this.kryptonButton_0);
			this.splitContainer1.Panel2.Controls.Add(this.btnOK);
			this.splitContainer1.Panel2.Controls.Add(this.kryptonLabel3);
			this.splitContainer1.Panel2.Controls.Add(this.kryptonLabel2);
			this.splitContainer1.Panel2.Controls.Add(this.kryptonLabel7);
			this.splitContainer1.Panel2.Controls.Add(this.kryptonLabel5);
			this.splitContainer1.Panel2.Controls.Add(this.kryptonLabel4);
			this.splitContainer1.Panel2.Controls.Add(this.kryptonLabel1);
			this.splitContainer1.Panel2.Controls.Add(this.txtTips);
			this.splitContainer1.Panel2.Controls.Add(this.WllYkmDbab);
			this.splitContainer1.Panel2.Controls.Add(this.txtCms);
			this.splitContainer1.Panel2.Controls.Add(this.txtGroupName);
			this.splitContainer1.Panel2.Controls.Add(this.txtTagName);
			this.splitContainer1.Panel2.Controls.Add(this.kryptonLabel6);
			this.splitContainer1.Panel2.Controls.Add(this.txtPx);
			this.splitContainer1.Size = new Size(761, 532);
			this.splitContainer1.SplitterDistance = 248;
			this.splitContainer1.TabIndex = 0;
			this.treeTags.ContextMenuStrip = this.menuGroup;
			this.treeTags.Dock = DockStyle.Fill;
			this.treeTags.Location = new Point(0, 0);
			this.treeTags.Name = "treeTags";
			this.treeTags.Size = new Size(248, 532);
			this.treeTags.TabIndex = 0;
			this.treeTags.AfterSelect += new TreeViewEventHandler(this.treeTags_AfterSelect);
			this.menuGroup.Font = new Font("Segoe UI", 9f);
			this.menuGroup.Items.AddRange(new ToolStripItem[]
			{
				this.增加标签ToolStripMenuItem,
				this.编辑组名称ToolStripMenuItem,
				this.删除改组ToolStripMenuItem,
				this.删除标签ToolStripMenuItem
			});
			this.menuGroup.Name = "menuGroup";
			this.menuGroup.Size = new Size(135, 92);
			this.增加标签ToolStripMenuItem.Name = "增加标签ToolStripMenuItem";
			this.增加标签ToolStripMenuItem.Size = new Size(134, 22);
			this.增加标签ToolStripMenuItem.Text = "增加标签";
			this.增加标签ToolStripMenuItem.Click += new EventHandler(this.增加标签ToolStripMenuItem_Click);
			this.编辑组名称ToolStripMenuItem.Name = "编辑组名称ToolStripMenuItem";
			this.编辑组名称ToolStripMenuItem.Size = new Size(134, 22);
			this.编辑组名称ToolStripMenuItem.Text = "重命名组名";
			this.删除改组ToolStripMenuItem.Name = "删除改组ToolStripMenuItem";
			this.删除改组ToolStripMenuItem.Size = new Size(134, 22);
			this.删除改组ToolStripMenuItem.Text = "删除该组";
			this.删除改组ToolStripMenuItem.Click += new EventHandler(this.删除改组ToolStripMenuItem_Click);
			this.删除标签ToolStripMenuItem.Name = "删除标签ToolStripMenuItem";
			this.删除标签ToolStripMenuItem.Size = new Size(134, 22);
			this.删除标签ToolStripMenuItem.Text = "删除标签";
			this.删除标签ToolStripMenuItem.Click += new EventHandler(this.删除标签ToolStripMenuItem_Click);
			this.label2.AutoSize = true;
			this.label2.ForeColor = Color.Gray;
			this.label2.Location = new Point(80, 111);
			this.label2.Name = "label2";
			this.label2.Size = new Size(377, 12);
			this.label2.TabIndex = 6;
			this.label2.Text = "给标签分组.比如全局标签,列表标签等等.分组将与卡片形式显示出来.";
			this.label1.AutoSize = true;
			this.label1.ForeColor = Color.Gray;
			this.label1.Location = new Point(80, 61);
			this.label1.Name = "label1";
			this.label1.Size = new Size(371, 12);
			this.label1.TabIndex = 6;
			this.label1.Text = "这里选择或填写文件名,如:dedecms,如果文件不存在,系统会自动创建";
			this.lbloptips.AutoSize = true;
			this.lbloptips.ForeColor = Color.Red;
			this.lbloptips.Location = new Point(80, 14);
			this.lbloptips.Name = "lbloptips";
			this.lbloptips.Size = new Size(209, 12);
			this.lbloptips.TabIndex = 6;
			this.lbloptips.Text = "如需要新增,请首先点击新增然后保存!";
			this.linkLabel1.AutoSize = true;
			this.linkLabel1.Location = new Point(14, 327);
			this.linkLabel1.Name = "linkLabel1";
			this.linkLabel1.Size = new Size(53, 12);
			this.linkLabel1.TabIndex = 5;
			this.linkLabel1.TabStop = true;
			this.linkLabel1.Text = "分享标签";
			this.linkLabel1.LinkClicked += new LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
			this.lblTips.AutoSize = true;
			this.lblTips.ForeColor = Color.Red;
			this.lblTips.Location = new Point(20, 474);
			this.lblTips.Name = "lblTips";
			this.lblTips.Size = new Size(125, 12);
			this.lblTips.TabIndex = 4;
			this.lblTips.Text = "欢迎使用标签设计器！";
			this.btnAdd.Location = new Point(300, 6);
			this.btnAdd.Name = "btnAdd";
			this.btnAdd.Size = new Size(56, 25);
			this.btnAdd.TabIndex = 3;
			this.btnAdd.Values.Text = "新增";
			this.btnAdd.Click += new EventHandler(this.btnAdd_Click);
			this.btnClose.Location = new Point(388, 464);
			this.btnClose.Name = "btnClose";
			this.btnClose.TabIndex = 3;
			this.btnClose.Values.Text = "关 闭";
			this.btnClose.Click += new EventHandler(this.btnClose_Click);
			this.btnUpdateGroup.Location = new Point(362, 83);
			this.btnUpdateGroup.Name = "btnUpdateGroup";
			this.btnUpdateGroup.Size = new Size(99, 25);
			this.btnUpdateGroup.TabIndex = 3;
			this.btnUpdateGroup.Values.Text = "更新组名";
			this.btnUpdateGroup.Click += new EventHandler(this.btnUpdateGroup_Click);
			this.kryptonButton_0.Location = new Point(388, 33);
			this.kryptonButton_0.Name = "btnSelCMS";
			this.kryptonButton_0.Size = new Size(73, 25);
			this.kryptonButton_0.TabIndex = 3;
			this.kryptonButton_0.Values.Text = "选择CMS";
			this.kryptonButton_0.Click += new EventHandler(this.kryptonButton_0_Click);
			this.btnOK.Location = new Point(283, 464);
			this.btnOK.Name = "btnOK";
			this.btnOK.TabIndex = 3;
			this.btnOK.Values.Text = "保存修改";
			this.btnOK.Click += new EventHandler(this.btnOK_Click);
			this.kryptonLabel3.Location = new Point(9, 253);
			this.kryptonLabel3.Name = "kryptonLabel3";
			this.kryptonLabel3.Size = new Size(73, 20);
			this.kryptonLabel3.TabIndex = 1;
			this.kryptonLabel3.Values.Text = "标签提示：";
			this.kryptonLabel2.Location = new Point(9, 174);
			this.kryptonLabel2.Name = "kryptonLabel2";
			this.kryptonLabel2.Size = new Size(73, 20);
			this.kryptonLabel2.TabIndex = 1;
			this.kryptonLabel2.Values.Text = "标签内容：";
			this.kryptonLabel7.Location = new Point(33, 11);
			this.kryptonLabel7.Name = "kryptonLabel7";
			this.kryptonLabel7.Size = new Size(48, 20);
			this.kryptonLabel7.TabIndex = 1;
			this.kryptonLabel7.Values.Text = "状态：";
			this.kryptonLabel5.Location = new Point(9, 36);
			this.kryptonLabel5.Name = "kryptonLabel5";
			this.kryptonLabel5.Size = new Size(73, 20);
			this.kryptonLabel5.TabIndex = 1;
			this.kryptonLabel5.Values.Text = "标签文件：";
			this.kryptonLabel4.Location = new Point(22, 86);
			this.kryptonLabel4.Name = "kryptonLabel4";
			this.kryptonLabel4.Size = new Size(60, 20);
			this.kryptonLabel4.TabIndex = 1;
			this.kryptonLabel4.Values.Text = "所属组：";
			this.kryptonLabel1.Location = new Point(9, 143);
			this.kryptonLabel1.Name = "kryptonLabel1";
			this.kryptonLabel1.Size = new Size(73, 20);
			this.kryptonLabel1.TabIndex = 1;
			this.kryptonLabel1.Values.Text = "标签名称：";
			this.txtTips.Location = new Point(82, 256);
			this.txtTips.Multiline = true;
			this.txtTips.Name = "txtTips";
			this.txtTips.ScrollBars = ScrollBars.Both;
			this.txtTips.Size = new Size(396, 197);
			this.txtTips.TabIndex = 0;
			this.txtTips.WordWrap = false;
			this.WllYkmDbab.Location = new Point(82, 174);
			this.WllYkmDbab.Multiline = true;
			this.WllYkmDbab.Name = "txtTagValue";
			this.WllYkmDbab.ScrollBars = ScrollBars.Both;
			this.WllYkmDbab.Size = new Size(396, 73);
			this.WllYkmDbab.TabIndex = 0;
			this.WllYkmDbab.WordWrap = false;
			this.txtCms.Location = new Point(82, 36);
			this.txtCms.Name = "txtCms";
			this.txtCms.Size = new Size(300, 20);
			this.txtCms.TabIndex = 0;
			this.txtCms.Text = "mytag";
			this.toolTip_0.SetToolTip(this.txtCms, "填写标签文件名称,系统会自动在tag目录创建相应文件,比如要创建dedecms.xml,这里就填写dedecms");
			this.txtGroupName.Location = new Point(82, 86);
			this.txtGroupName.Name = "txtGroupName";
			this.txtGroupName.Size = new Size(274, 20);
			this.txtGroupName.TabIndex = 0;
			this.txtGroupName.Text = "全局标签";
			this.toolTip_0.SetToolTip(this.txtGroupName, "给标签分组.比如全局标签,列表标签等等.分组将与卡片形式显示出来.");
			this.txtTagName.Location = new Point(82, 143);
			this.txtTagName.Name = "txtTagName";
			this.txtTagName.Size = new Size(274, 20);
			this.txtTagName.TabIndex = 0;
			this.kryptonLabel6.Location = new Point(362, 143);
			this.kryptonLabel6.Name = "kryptonLabel6";
			this.kryptonLabel6.Size = new Size(60, 20);
			this.kryptonLabel6.TabIndex = 1;
			this.kryptonLabel6.Values.Text = "排序值：";
			this.kryptonLabel6.Visible = false;
			this.txtPx.Location = new Point(422, 143);
			this.txtPx.Name = "txtPx";
			this.txtPx.Size = new Size(39, 18);
			this.txtPx.TabIndex = 0;
			this.txtPx.Text = "0";
			this.txtPx.Visible = false;
			this.openFileDialog_0.AddExtension = false;
			this.openFileDialog_0.Filter = "标签文件|*.xml";
			this.openFileDialog_0.Title = "请选择标签文件";
			this.toolTip_0.AutoPopDelay = 10000;
			this.toolTip_0.InitialDelay = 500;
			this.toolTip_0.ReshowDelay = 100;
			this.toolTip_0.ShowAlways = true;
			this.toolTip_0.ToolTipIcon = ToolTipIcon.Info;
			this.toolTip_0.ToolTipTitle = "操作步骤:第一步,选择cms,如果新建,直接填写如:dedecms";
			this.linkLabel3.AutoSize = true;
			this.linkLabel3.Location = new Point(368, 13);
			this.linkLabel3.Name = "linkLabel3";
			this.linkLabel3.Size = new Size(95, 12);
			this.linkLabel3.TabIndex = 5;
			this.linkLabel3.TabStop = true;
			this.linkLabel3.Text = "如何自定义标签?";
			this.linkLabel3.LinkClicked += new LinkLabelLinkClickedEventHandler(this.lquYdggUtx);
			base.AutoScaleDimensions = new SizeF(6f, 12f);
			base.AutoScaleMode = AutoScaleMode.Font;
			base.ClientSize = new Size(761, 532);
			base.Controls.Add(this.splitContainer1);
			base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
			base.MaximizeBox = false;
			base.Name = "TagEditFrm";
			base.ShowIcon = false;
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "都客标签设计器 www.mou18.com";
			this.splitContainer1.Panel1.ResumeLayout(false);
			this.splitContainer1.Panel2.ResumeLayout(false);
			this.splitContainer1.Panel2.PerformLayout();
			this.splitContainer1.ResumeLayout(false);
			this.menuGroup.ResumeLayout(false);
			base.ResumeLayout(false);
		}

		// Token: 0x06000214 RID: 532 RVA: 0x0001A348 File Offset: 0x00018548
		private void kryptonButton_0_Click(object sender, EventArgs e)
		{
			using (OpenFileDialog openFileDialog = new OpenFileDialog())
			{
				openFileDialog.RestoreDirectory = true;
				if (!Directory.Exists(Comm.root + "tag"))
				{
					Directory.CreateDirectory(Comm.root + "tag");
				}
				openFileDialog.InitialDirectory = Comm.root + "tag";
				openFileDialog.Filter = "标签文件|*.xml";
				openFileDialog.FilterIndex = 0;
				if (DialogResult.OK == openFileDialog.ShowDialog() && openFileDialog.FileName != "")
				{
					this.txtCms.Text = openFileDialog.SafeFileName.Replace(".xml", "");
					this.method_0();
				}
			}
		}

		// Token: 0x0600021B RID: 539 RVA: 0x0001A788 File Offset: 0x00018988
		private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			Process.Start("http://qun.t.qq.com/66127144");
		}

		// Token: 0x0600021D RID: 541 RVA: 0x0001A898 File Offset: 0x00018A98
		private void lquYdggUtx(object sender, LinkLabelLinkClickedEventArgs e)
		{
			Process.Start("http://user.qzone.qq.com/1902976602/blog/1351762348");
		}

		// Token: 0x06000213 RID: 531 RVA: 0x0001A0C8 File Offset: 0x000182C8
		private void method_0()
		{
			this.treeTags.Nodes.Clear();
			string text = this.txtCms.Text.Trim() + ".xml";
			this.Text = "标签设计器 当前标签:" + text;
			string text2 = Comm.root + "\\tag\\" + text;
			if (File.Exists(text2))
			{
				try
				{
					XmlDocument xmlDocument = new XmlDocument();
					xmlDocument.Load(text2);
					XmlNode xmlNode = xmlDocument.SelectSingleNode("//tags");
					foreach (XmlNode xmlNode2 in xmlNode.SelectNodes("group"))
					{
						TreeNode treeNode = new TreeNode();
						treeNode.Text = xmlNode2.Attributes["name"].Value;
						treeNode.Tag = new TagInfo
						{
							GroupName = treeNode.Text
						};
						foreach (XmlNode xmlNode3 in xmlNode2.SelectNodes("tag"))
						{
							TreeNode treeNode2 = new TreeNode();
							treeNode2.Text = xmlNode3.Attributes["name"].Value;
							treeNode2.Tag = new TagInfo
							{
								CmsName = text.Replace(".xml", ""),
								TagName = xmlNode3.Attributes["name"].Value,
								TagValue = xmlNode3.SelectSingleNode("value").InnerText,
								TagTips = xmlNode3.SelectSingleNode("tips").InnerText,
								GroupName = treeNode.Text,
								px = 0
							};
							treeNode.Nodes.Add(treeNode2);
						}
						this.treeTags.Nodes.Add(treeNode);
						this.treeTags.ExpandAll();
					}
				}
				catch
				{
				}
			}
		}

		// Token: 0x06000215 RID: 533 RVA: 0x0001A414 File Offset: 0x00018614
		private void treeTags_AfterSelect(object sender, TreeViewEventArgs e)
		{
			TagEditFrm.treeNode_0 = e.Node;
			if (e.Node.Level == 0)
			{
				this.lbloptips.Text = "选择组:" + e.Node.Text;
				this.txtGroupName.Text = e.Node.Text;
				this.txtTagName.Text = "";
				this.WllYkmDbab.Text = "";
				this.txtTips.Text = "";
				this.btnOK.Enabled = false;
				this.btnUpdateGroup.Enabled = true;
				return;
			}
			if (e.Node.Level == 1)
			{
				this.btnOK.Enabled = true;
				this.btnUpdateGroup.Enabled = false;
				TagInfo tagInfo = e.Node.Tag as TagInfo;
				if (tagInfo != null)
				{
					this.lbloptips.Text = "修改标签:" + tagInfo.TagName;
					this.txtCms.Text = tagInfo.CmsName;
					this.txtGroupName.Text = tagInfo.GroupName;
					this.txtTagName.Text = tagInfo.TagName;
					this.WllYkmDbab.Text = tagInfo.TagValue;
					this.txtTips.Text = tagInfo.TagTips;
					this.txtPx.Text = tagInfo.px.ToString();
				}
			}
		}

		// Token: 0x0600021A RID: 538 RVA: 0x0001A700 File Offset: 0x00018900
		private void 删除改组ToolStripMenuItem_Click(object sender, EventArgs e)
		{
			if (this.treeTags.SelectedNode.Level == 0)
			{
				TreeNode selectedNode = this.treeTags.SelectedNode;
				object arg_24_0 = selectedNode.Tag;
				string str = this.txtCms.Text.Trim() + ".xml";
				string xmlFileName = Comm.root + "\\tag\\" + str;
				if (XMLHelper.DeleteXmlNodeByXPath(xmlFileName, "//tags/group[@name='" + selectedNode.Text + "']"))
				{
					this.method_0();
				}
				TagEditFrm.treeNode_0 = null;
			}
		}

		// Token: 0x06000219 RID: 537 RVA: 0x0001A644 File Offset: 0x00018844
		private void 删除标签ToolStripMenuItem_Click(object sender, EventArgs e)
		{
			if (this.treeTags.SelectedNode.Level == 1)
			{
				TreeNode selectedNode = this.treeTags.SelectedNode;
				TagInfo tagInfo = selectedNode.Tag as TagInfo;
				string str = this.txtCms.Text.Trim() + ".xml";
				string xmlFileName = Comm.root + "\\tag\\" + str;
				if (XMLHelper.DeleteXmlNodeByXPath(xmlFileName, string.Concat(new string[]
				{
					"//tags/group[@name='",
					tagInfo.GroupName,
					"']/tag[@name='",
					tagInfo.TagName,
					"']"
				})))
				{
					this.method_0();
				}
				TagEditFrm.treeNode_0 = null;
			}
		}

		// Token: 0x06000218 RID: 536 RVA: 0x0001A604 File Offset: 0x00018804
		private void 增加标签ToolStripMenuItem_Click(object sender, EventArgs e)
		{
			this.txtTagName.Text = "";
			this.WllYkmDbab.Text = "";
			this.txtTips.Text = "";
			this.txtTagName.Focus();
		}

		// Token: 0x04000246 RID: 582
		private KryptonButton btnAdd;

		// Token: 0x04000236 RID: 566
		private KryptonButton btnClose;

		// Token: 0x04000237 RID: 567
		private KryptonButton btnOK;

		// Token: 0x04000248 RID: 584
		private KryptonButton btnUpdateGroup;

		// Token: 0x0400022D RID: 557
		private IContainer icontainer_0;

		// Token: 0x0400023B RID: 571
		private KryptonButton kryptonButton_0;

		// Token: 0x04000232 RID: 562
		private KryptonLabel kryptonLabel1;

		// Token: 0x04000231 RID: 561
		private KryptonLabel kryptonLabel2;

		// Token: 0x04000230 RID: 560
		private KryptonLabel kryptonLabel3;

		// Token: 0x04000238 RID: 568
		private KryptonLabel kryptonLabel4;

		// Token: 0x0400023D RID: 573
		private KryptonLabel kryptonLabel5;

		// Token: 0x04000244 RID: 580
		private KryptonLabel kryptonLabel6;

		// Token: 0x0400024A RID: 586
		private KryptonLabel kryptonLabel7;

		// Token: 0x0400024C RID: 588
		private Label label1;

		// Token: 0x0400024D RID: 589
		private Label label2;

		// Token: 0x04000249 RID: 585
		private Label lbloptips;

		// Token: 0x0400023A RID: 570
		private Label lblTips;

		// Token: 0x04000247 RID: 583
		private LinkLabel linkLabel1;

		// Token: 0x0400024E RID: 590
		private LinkLabel linkLabel3;

		// Token: 0x0400023E RID: 574
		private ContextMenuStrip menuGroup;

		// Token: 0x04000243 RID: 579
		private OpenFileDialog openFileDialog_0;

		// Token: 0x0400022E RID: 558
		private SplitContainer splitContainer1;

		// Token: 0x0400024B RID: 587
		private ToolTip toolTip_0;

		// Token: 0x0400022C RID: 556
		private static TreeNode treeNode_0;

		// Token: 0x0400022F RID: 559
		private TreeView treeTags;

		// Token: 0x0400023C RID: 572
		private KryptonTextBox txtCms;

		// Token: 0x04000239 RID: 569
		private KryptonTextBox txtGroupName;

		// Token: 0x04000245 RID: 581
		private KryptonTextBox txtPx;

		// Token: 0x04000235 RID: 565
		private KryptonTextBox txtTagName;

		// Token: 0x04000233 RID: 563
		private KryptonTextBox txtTips;

		// Token: 0x04000234 RID: 564
		private KryptonTextBox WllYkmDbab;

		// Token: 0x04000241 RID: 577
		private ToolStripMenuItem 删除改组ToolStripMenuItem;

		// Token: 0x04000242 RID: 578
		private ToolStripMenuItem 删除标签ToolStripMenuItem;

		// Token: 0x0400023F RID: 575
		private ToolStripMenuItem 增加标签ToolStripMenuItem;

		// Token: 0x04000240 RID: 576
		private ToolStripMenuItem 编辑组名称ToolStripMenuItem;
	}
}
